<?php
declare (strict_types = 1);

namespace app\admin\controller;

use app\common\controller\Admin;
use think\Request;

class Assets extends Admin
{
    protected $table_id = false;
    public function initialize()
    {
        $this->menu_input = [
            'all' => [
                ['type' => 'text', 'name' => '标题', 'key' => 'title','verify'=>'required'],
                ['type' => 'text', 'name' => '内容', 'key' => 'value','verify'=>'required'],
            ],
            'add' => [

            ],
            'upload' => [

            ],
        ];
        if(input('parent')){
            $this->menu_input['all'][0]['select']['where'] = ['key'=>'parent_id','value'=>input('parent')];
        }
        parent::initialize(); // TODO: Change the autogenerated stub
    }
    public function table_mage(&$data = [])
    {
        $data = [
            ['field' => 'title', 'title' => '标题'],
            ['field' => 'value', 'title' => '内容'],
            ['field' => 'update_time', 'title' => '修改时间'],
//            ['title' => '操作', 'templet' => '#list_setting']
        ];
        return parent::table_mage($data); // TODO: Change the autogenerated stub
    }

}
